<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<meta http-equiv="cache-control" content="no-cache">
<title>Genivia - XML namespace tables</title>
<link href="genivia_tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="genivia_content.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="top">
 <div id="titlearea">
  <table height="72px" width="100%" cellspacing="0" cellpadding="0">
   <tbody>
    <tr>
     <td width="10%">&nbsp;</td>
     <td width="175px"><a href="https://www.genivia.com"><img alt="Genivia" src="GeniviaLogo2_trans_noslogan.png"/></a></td>
     <td class="tab_home"><a href="https://www.genivia.com">Home</a></td>
     <td class="tab_home"><a href="https://www.genivia.com/docs.html">Documentation</a></td>
     <td>
      <div style="float: right; font-size: 18px; font-weight: bold;">XML namespace tables</div>
      <br>
      <div style="float: right; font-size: 10px;">updated Thu Dec 23 2021 by Robert van Engelen</div>
     </td>
     <td width="10%">&nbsp;</td>
    </tr>
   </tbody>
  </table>
 </div>
<!-- Generated by Doxygen 1.8.11 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__group__namespace.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<div class="title">XML namespace tables</div>  </div>
</div><!--header-->
<div class="contents">

<p>This module defines the <code><a class="el" href="struct_namespace.html" title="Structure of each row in a namespace table. ">Namespace</a></code> XML namespace structure and function to activate a table.  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_namespace.html">Namespace</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Structure of each row in a namespace table.  <a href="struct_namespace.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga5ec913accc705cca3296ab75bae955a5"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__namespace.html#ga5ec913accc705cca3296ab75bae955a5">soap_set_namespaces</a> (struct <a class="el" href="structsoap.html">soap</a> *<a class="el" href="structsoap.html">soap</a>, const struct <a class="el" href="struct_namespace.html">Namespace</a> *<a class="el" href="group__group__namespace.html#gaabfac0a3b8d38498bc5e1e3bc465ead6">namespaces</a>)</td></tr>
<tr class="memdesc:ga5ec913accc705cca3296ab75bae955a5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Activates an XML namespace table to generate and resolve xmlns namespace prefixes in XML messages.  <a href="#ga5ec913accc705cca3296ab75bae955a5">More...</a><br /></td></tr>
<tr class="separator:ga5ec913accc705cca3296ab75bae955a5"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:gaabfac0a3b8d38498bc5e1e3bc465ead6"><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="struct_namespace.html">Namespace</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__namespace.html#gaabfac0a3b8d38498bc5e1e3bc465ead6">namespaces</a> []</td></tr>
<tr class="memdesc:gaabfac0a3b8d38498bc5e1e3bc465ead6"><td class="mdescLeft">&#160;</td><td class="mdescRight">The global XML namespaces table with entries defined by the <code><a class="el" href="struct_namespace.html" title="Structure of each row in a namespace table. ">Namespace</a></code> structure and populated in an .nsmap file generated by soapcpp2.  <a href="#gaabfac0a3b8d38498bc5e1e3bc465ead6">More...</a><br /></td></tr>
<tr class="separator:gaabfac0a3b8d38498bc5e1e3bc465ead6"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>This module defines the <code><a class="el" href="struct_namespace.html" title="Structure of each row in a namespace table. ">Namespace</a></code> XML namespace structure and function to activate a table. </p>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ga5ec913accc705cca3296ab75bae955a5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int soap_set_namespaces </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname"><em>soap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const struct <a class="el" href="struct_namespace.html">Namespace</a> *&#160;</td>
          <td class="paramname"><em>namespaces</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Activates an XML namespace table to generate and resolve xmlns namespace prefixes in XML messages. </p>
<p>This function sets the XML namespace table to be used by the engine to generate and resolve xmlns namespace prefixes in XML messages. Different tables can be set at any time, depending on the XML messaging requirements. However, XML generation and parsing may fail if prefix-URI bindings are missing in the table. Tables are generated by soapcpp2 in .nsmap files, which defines a global table <code><a class="el" href="group__group__namespace.html#gaabfac0a3b8d38498bc5e1e3bc465ead6" title="The global XML namespaces table with entries defined by the Namespace structure and populated in an ...">namespaces</a></code> that is used by default by the engines, but can be replaced by the XML namespace table specified with this function. Returns <code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> or a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code.</p>
<dl class="section user"><dt>Example:</dt><dd><div class="fragment"><div class="line"><span class="preprocessor">#include &quot;soapH.h&quot;</span></div><div class="line"></div><div class="line"><span class="keyword">struct </span><a class="code" href="struct_namespace.html">Namespace</a> my_namespaces[] = {</div><div class="line">  { <span class="stringliteral">&quot;SOAP-ENV&quot;</span>, <span class="stringliteral">&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;</span>, <span class="stringliteral">&quot;http://www.w3.org/*soap-envelope&quot;</span>,      NULL },</div><div class="line">  { <span class="stringliteral">&quot;SOAP-ENC&quot;</span>, <span class="stringliteral">&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;</span>, <span class="stringliteral">&quot;http://www.w3.org/*soap-encoding&quot;</span>,      NULL },</div><div class="line">  { <span class="stringliteral">&quot;xsi&quot;</span>,      <span class="stringliteral">&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</span>, <span class="stringliteral">&quot;http://www.w3.org/*XMLSchema-instance&quot;</span>, NULL },</div><div class="line">  { <span class="stringliteral">&quot;xsd&quot;</span>,      <span class="stringliteral">&quot;http://www.w3.org/2001/XMLSchema&quot;</span>,          <span class="stringliteral">&quot;http://www.w3.org/*XMLSchema&quot;</span>,          NULL },</div><div class="line">  { <span class="stringliteral">&quot;ns&quot;</span>,       <span class="stringliteral">&quot;http://tempuri.org/ns.xsd&quot;</span>,                 NULL,                                    NULL },</div><div class="line">  { NULL,       NULL,                                        NULL,                                    NULL }</div><div class="line">};</div><div class="line"></div><div class="line"><span class="keyword">struct </span>soap *soap = <a class="code" href="group__group__context.html#ga87c20488b2dc680aaa7689b1d024989c">soap_new</a>();</div><div class="line"><a class="code" href="group__group__namespace.html#ga5ec913accc705cca3296ab75bae955a5">soap_set_namespaces</a>(soap, my_namespaces); <span class="comment">// use a specific XML namespace binding table for the next call</span></div><div class="line"><span class="keywordflow">if</span> (soap_call_ns__webmethod(soap, <a class="code" href="structsoap.html#aed1b86b8a34aea86103751a932c9dce9">endpoint</a>, NULL, ...))</div><div class="line">{</div><div class="line">  <a class="code" href="group__group__fault.html#ga931a4ab6df2553b48a0c270f8a0a88af">soap_print_fault</a>(soap, stderr);</div><div class="line">}</div><div class="line"><span class="keywordflow">else</span></div><div class="line">{</div><div class="line">  ...</div><div class="line">}</div><div class="line"><a class="code" href="group__group__namespace.html#ga5ec913accc705cca3296ab75bae955a5">soap_set_namespaces</a>(soap, <a class="code" href="group__group__namespace.html#gaabfac0a3b8d38498bc5e1e3bc465ead6">namespaces</a>); <span class="comment">// use the default XML namespace binding table, when defined, for the next call</span></div></div><!-- fragment --></dd></dl>
<p>This example defines SOAP 1.1 namespaces (<code>SOAP-ENV</code> and <code>SOAP-ENC</code>) to be used by default, but also accepts SOAP 1.2 because of the second URI in the third column. XML schema instance namespace <code>xsi</code> is used with <em><code>xsi:type</code></em> and <em><code>xsi:nil</code></em> and the XML schema namespace <code>xsd</code> is used with XSD types such as <em><code>xsd:string</code></em>, which may be used in XML messages. URI patterns in the third column may contain wildcard strings <code>*</code> and wildcard characters <code>-</code>.</p><dl class="section return"><dt>Returns</dt><dd><code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> or a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td><code><a class="el" href="structsoap.html" title="Context with the engine state. ">soap</a></code> context </td></tr>
    <tr><td class="paramname">namespaces</td><td>the XML namespace table to activate </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
<a class="anchor" id="gaabfac0a3b8d38498bc5e1e3bc465ead6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct <a class="el" href="struct_namespace.html">Namespace</a> namespaces[]</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The global XML namespaces table with entries defined by the <code><a class="el" href="struct_namespace.html" title="Structure of each row in a namespace table. ">Namespace</a></code> structure and populated in an .nsmap file generated by soapcpp2. </p>
<p>This XML namespaces table defines XML namespace prefix-URI pairs for XML generation, parsing and validation. The last row in the table must be followed by a row with a NULL value to indicate the end of the table. The requirement to link this global table can be removed at compile time with <code><a class="el" href="group__group__with.html#gac22000b4058bb41a88750d10785baaf1" title="When this macro is defined at compile time (undefined by default), removes dependence on the global n...">WITH_NONAMESPACES</a></code>. </p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<hr class="footer">
<address class="footer">
Copyright (C) 2021, Robert van Engelen, Genivia Inc., All Rights Reserved.
</address>
<address class="footer"><small>
Converted on Thu Dec 23 2021 13:46:46 by <a target="_blank" href="http://www.doxygen.org/index.html">Doxygen</a> 1.8.11</small></address>
<br>
<div style="height: 246px; background: #DBDBDB;">
</body>
</html>
